* keyboard.c (make_lispy_event): Fix problem in integer overflow.
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 12 May 2011 19:37:40 +0000 (12:37 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 12 May 2011 19:37:40 +0000 (12:37 -0700)
commitbb13e2b3abd0c8ce0d95a516a668de54b609857b
treebaa768e741f7c24b24b08c52d9be990fd25a0597
parent1ef5d00a11367a9910a366a23f912bdce1bd19e5
* keyboard.c (make_lispy_event): Fix problem in integer overflow.

Don't assume that the difference between two unsigned long values
can fit into an integer.  At this point, we know button_down_time
<= event->timestamp, so the difference must be nonnegative, so
there's no need to cast the result if double-click-time is
nonnegative, as it should be; check that it's nonnegative, just in
case.  This bug is triggered when events are more than 2**31 ms
apart (about 25 days).
src/ChangeLog
src/keyboard.c